-- GENERATED SPELL FOR [Dreadlord] --


function spell0_8716(pUnit, Event) --@Mind Blast,n/a--
pUnit:FullCastSpellOnTarget(17287,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8716', 1500, 1)
end

function spell1_8716(pUnit, Event) --@Psychic Scream,Self--
pUnit:FullCastSpellOnTarget(13704,pUnit)
pUnit:RegisterEvent('Sorts_8716', 6277, 1)
end

function spell2_8716(pUnit, Event) --@Sleep,n/a--
pUnit:FullCastSpellOnTarget(12098,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8716', 21000, 1)
end

function Sorts_8716(pUnit, Event)
local choix_sorts_8716 = math.random(0, 2)
if choix_sorts_8716 == 0 then
pUnit:RegisterEvent('spell0_8716', 1, 1)
end
if choix_sorts_8716 == 1 then
pUnit:RegisterEvent('spell1_8716', 1, 1)
end
if choix_sorts_8716 == 2 then
pUnit:RegisterEvent('spell2_8716', 1, 1)
end
end

function mob8716_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_8716', math.random(1500, 3000), 1)
end

function mob8716_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8716_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8716_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(8716, 1, 'mob8716_Action')
RegisterUnitEvent(8716, 2, 'mob8716_Leave')
RegisterUnitEvent(8716, 3, 'mob8716_Kill')
RegisterUnitEvent(8716, 4, 'mob8716_Die')
